package com.wsl.tibet_provider.controller;

import com.wsl.pojo.Tb_brand;
import com.wsl.service.Tb_brandService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/brand")
public class Tb_brandContorller {
    @Autowired
    private Tb_brandService tb_brandService;

    //查询品牌的所有
    @RequestMapping("/findall")
    public List<Tb_brand> findallbrand() {
        return tb_brandService.findallBrand();
    }

    //增加品牌
    @RequestMapping("/inter")
    public void interdbrand(@RequestBody Tb_brand tb_brand) {
        tb_brandService.interdbrand(tb_brand);
    }

    //品牌的删除
    @RequestMapping("/delete/{id}")
    public void deletebrand(@PathVariable("id") Integer id) {
        tb_brandService.deletebrand(id);
    }

    //品牌的修改
    @RequestMapping("/update")
    public void update(@RequestBody Tb_brand tb_brand) {
        tb_brandService.update(tb_brand);
    }

}
